import resolve from '@rollup/plugin-node-resolve';
import babel from 'rollup-plugin-babel';
import { terser } from 'rollup-plugin-terser';
import banner from 'rollup-plugin-banner'

export default {
    input: 'index.js',
    output: {
        file: 'dist/angular-table-resize.min.js',
        format: 'cjs', // immediately-invoked function expression — suitable for <script> tags
        strict: false,
        intro: '!(function(window, angular){\'use strict\';',
        outro: '})(window, window.angular)',
        sourcemap: true
    },
    plugins: [
        resolve(), // tells Rollup how to find modules in node_modules
        babel({
            exclude: 'node_modules/**' // only transpile our source code
        }),
        terser({
            // keep_fnames: true
            mangle: {
                reserved: ['window', 'angular', '$parse', '$document', '$compile']
            }
        }),
        banner('angular-table-resize\nv<%= pkg.version %>\nby <%= pkg.author %>')
    ]
};